package com.example.androidstart;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.androidstart.obj.ObjRenderActivity;
import com.example.androidstart.opengl.DrawShapeActivity;
import com.example.androidstart.opengl.CameraActivity;

public class openglesActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_opengles2);
        findViewById(R.id.draw_shape).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(openglesActivity.this, DrawShapeActivity.class);
                intent.putExtra("drawtype","triangle");
                openglesActivity.this.startActivity(intent);
            }
        });
        findViewById(R.id.open_camera).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(openglesActivity.this, CameraActivity.class);
                openglesActivity.this.startActivity(intent);
            }
        });
        findViewById(R.id.load_obj).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(openglesActivity.this, ObjRenderActivity.class);
                openglesActivity.this.startActivity(intent);
            }
        });

        findViewById(R.id.load_image).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(openglesActivity.this, DrawShapeActivity.class);
                intent.putExtra("drawtype","image");
                openglesActivity.this.startActivity(intent);
            }
        });
        findViewById(R.id.load_IsoscelesTriangle).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(openglesActivity.this, DrawShapeActivity.class);
                intent.putExtra("drawtype","IsoscelesTriangle");
                openglesActivity.this.startActivity(intent);
            }
        });
      findViewById(R.id.load_colorfulTriangle).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(openglesActivity.this, DrawShapeActivity.class);
                intent.putExtra("drawtype","colorfulTriangle");
                openglesActivity.this.startActivity(intent);
            }
        });

        findViewById(R.id.load_square).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(openglesActivity.this, DrawShapeActivity.class);
                intent.putExtra("drawtype","square");
                openglesActivity.this.startActivity(intent);
            }
        });
        findViewById(R.id.circle_shape).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(openglesActivity.this, DrawShapeActivity.class);
                intent.putExtra("drawtype","circle");
                openglesActivity.this.startActivity(intent);
            }
        });
        findViewById(R.id.Cube).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(openglesActivity.this, DrawShapeActivity.class);
                intent.putExtra("drawtype","Cube");
                openglesActivity.this.startActivity(intent);
            }
        });
    }
}